#include <QtGui/QApplication>
#include <QTimer>
#include "frm_welcome.h"
#include "frm_menu.h"
#include "frm_profile.h"
#include <QFile>
#include <QTextStream>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    frm_welcome *welcome = new frm_welcome();
    welcome->show();
    QFile profiledata("/sdcard/FitByYou/profile.txt");
    if(!profiledata.open(QIODevice::ReadOnly))
        qFatal("Error de lectura del fichero profile.txt");
    QTextStream in(&profiledata);
    QString regist=in.readLine();
    profiledata.close();
    if(!regist.toInt()){
            frm_profile *profile = new frm_profile();
            QTimer::singleShot(2000,welcome,SLOT(hide()));
            QTimer::singleShot(2000,profile,SLOT(show()));
    }
    else{
        frm_menu *menu = new frm_menu();
        QTimer::singleShot(2000,welcome,SLOT(hide()));
        QTimer::singleShot(2000,menu,SLOT(show()));
    }
    return a.exec();
}
